<template>
  <form ref="form">
    <span>用户名： </span>
    <input type="text" name="username" v-model="form.username" /> <br />
    <span>密码： </span>
    <input type="text" name="password" v-model="form.password" />
  </form>
</template>

<script>
export default {
  data() {
    return {
      form: {
        username: '',
        password: '',
      },
    }
  },

  methods: {
    submit() {
      console.log(this.form.username)
      console.log(this.form.password)

      //   this.$refs.form.reset()
      this.form.username = ''
      this.form.password = ''
    },
  },
}
</script>
